import type { Component } from "vue";
import { ComponentType } from "./types";

import Select from "./components/Select.vue";

const componentMap = new Map<ComponentType, Component>();

componentMap.set("Input", ElInput);
componentMap.set("InputNumber", ElInputNumber);
componentMap.set("Select", Select);
export function getComponent(name: ComponentType) {
  if (componentMap.has(name)) {
    return componentMap.get(name);
  }
  throw new Error("没有找到该组件");
}

export { componentMap };
